#include <stdio.h>
#include <stdlib.h>

#include "symbolMgt.h"
int main( int argc, char *argv[] )
{
int *ref1, *ref2;

  insertInSymbolTable( "AA", TREE_NODE );
  insertInSymbolTable( "BB", TREE_NODE );
  insertInSymbolTable( "WW", TREE_STRUCT );

  ref1 = malloc(sizeof(int));
  ref2 = malloc(sizeof(int));
  fprintf(stderr, "ref1 = %p\n", ref1);
  fprintf(stderr, "ref2 = %p\n", ref2);

  setRefForSymbolInTable("AA", ref1);
  setRefForSymbolInTable("BB", ref2);
  setRefForSymbolInTable("CC", ref2); /* incorrect but should not crash */

  fprintf( stderr, "------------ symbolTable :\n");
  printSymbolTable( );
  fprintf( stderr, "\n" );

  fprintf(stderr, "AA ref1 = %p\n", getRefForSymbolInTable("AA"));
  fprintf(stderr, "BB ref2 = %p\n", getRefForSymbolInTable("BB"));
  fprintf(stderr, "WW ref3 = %p\n", getRefForSymbolInTable("WW")); /* incorrect but should not crash */
  return EXIT_SUCCESS;
}

